import { createRouter, createWebHashHistory } from 'vue-router';
import ProductsPage from '@/components/ProductsPage.vue';
import ProductPage from '@/components/ProductPage.vue';
import ErrorPage from '@/components/ErrorPage.vue';

const routes = [
    {
        path: '/',
        name: 'ProductsPage',
        component: ProductsPage,
    },
    {
        path: '/product/:id',
        name: 'ProductPage',
        component: ProductPage,
    },
    {
        path: '/errorPage',
        name: 'ErrorPage',
        component: ErrorPage,
    },
];

const router = createRouter({
    history: createWebHashHistory(),
    routes,
});

export default router;
